package com.rykj.qxj.server.util;

import java.util.Date;

/**
 * 气象局短信专用
 */
public class SmsUtil {

    final static String oracle_url = "jdbc:oracle:thin:@10.153.97.30:1521:SZQX";
    final static String user_name = "qxsjglxt";
    final static String pass_word = "pwdqxsj#2019";
    final static String oracle_driver = "oracle.jdbc.driver.OracleDriver";
    public static void sendDX(String phone,String content){
        JdbcClient jdbcClient = null;
        try {
            jdbcClient = new JdbcClient(oracle_url,user_name,pass_word,oracle_driver);
            String id = ShortUUID.generateShortUuid();
            String dwId = "07"; //单位ID
            String ywId = "92";   //业务ID
            String clientName = "inter_qxsjglxt"; //用户账号
            String sendPort = "88"; //发送端口
            String mobileNo = phone; //手机号码
            Date crttime = new Date();
            String sql = "insert into T_SMSSENDLIST(ID,DWID,YWID,CLIENTNAME,SENDPORT,MOBILENO,CONTENT)values " +
                    "('" + id + "','" + dwId + "','" +ywId + "','" + clientName + "','" +sendPort + "','" + mobileNo + "','" +content + "'" + ")";
            jdbcClient.excuteSql(sql);
        }  catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        sendDX("15016710125","阿里云平台告警:PostCheck检查不通过");
        sendDX("13882162641","阿里云平台告警:PostCheck检查不通过");
    }
}
